package com;


import java.util.Random;
import java.util.Scanner;

public class Kratnost {
		public static void main(String[] args){
			Random r = new Random();
			int k=r.nextInt(50)+1;
//			System.out.println(k);
			
	if (k%3==0)
	System.out.println("Chislo " + k + " kratno trem");
	else
	System.out.println("Chislo " + k + " ne kratno trem");
	

	System.out.println("Average = "+ avg());}

public static double avg () {
	Scanner scanner = new Scanner(System.in);
	System.out.println("Enter the number of elements: ");
	int n=scanner.nextInt(); 
	int s=0;
	int intAr[];
	intAr = new int[n];
	for (int i=0; i<n;i++){
		intAr[i]=i+1;
		System.out.println(intAr[i]);
		s=s+intAr[i];
	}
	System.out.println("Summa = "+ s);
	System.out.println("Number of elements = "+ n);
	  double average = s/n;
	  return average;
	}
}

